From: Keir Fraser Date: Thu, 11 Feb 2010 19:51:15 +0000 (+0000) Subject: VT-d: get rid of duplicated definition X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~12614 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=8eddd7f405d7120aaf284c222e119588275bed3f;p=xen.git VT-d: get rid of duplicated definition free_pgtable_maddr was implemented the same for x86 and IA64, so it's not necessary to define it separately for x86 and IA64. This patch moves free_pgtable_maddr definition to iommu.c to avoid duplicated definition. Signed-off-by: Weidong Han --- diff --git a/xen/drivers/passthrough/vtd/ia64/vtd.c b/xen/drivers/passthrough/vtd/ia64/vtd.c index 5158060457..7b740d2d84 100644 --- a/xen/drivers/passthrough/vtd/ia64/vtd.c +++ b/xen/drivers/passthrough/vtd/ia64/vtd.c @@ -46,12 +46,6 @@ void unmap_vtd_domain_page(void *va) unmap_domain_page(va); } -void free_pgtable_maddr(u64 maddr) -{ - if ( maddr != 0 ) - free_domheap_page(maddr_to_page(maddr)); -} - unsigned int get_cache_line_size(void) { return L1_CACHE_BYTES; diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index c03e9ce300..bf325a8d5f 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -193,6 +193,12 @@ u64 alloc_pgtable_maddr(struct acpi_drhd_unit *drhd, unsigned long npages) return page_to_maddr(pg); } +void free_pgtable_maddr(u64 maddr) +{ + if ( maddr != 0 ) + free_domheap_page(maddr_to_page(maddr)); +} + /* context entry handling */ static u64 bus_to_context_maddr(struct iommu *iommu, u8 bus) { diff --git a/xen/drivers/passthrough/vtd/x86/vtd.c b/xen/drivers/passthrough/vtd/x86/vtd.c index c5435b6f27..74e31ccb72 100644 --- a/xen/drivers/passthrough/vtd/x86/vtd.c +++ b/xen/drivers/passthrough/vtd/x86/vtd.c @@ -44,12 +44,6 @@ void unmap_vtd_domain_page(void *va) unmap_domain_page(va); } -void free_pgtable_maddr(u64 maddr) -{ - if ( maddr != 0 ) - free_domheap_page(maddr_to_page(maddr)); -} - unsigned int get_cache_line_size(void) { return ((cpuid_ebx(1) >> 8) & 0xff) * 8;